Field of the Invention
Embodiments of the present invention relate generally to graphics processing and, more specifically, to pixel serialization to improve conservative depth estimation.
Description of the Related Art
Conventional graphics rendering pipelines include a rasterization stage in which geometry and vertex data are converted into fragment and pixel data. The resulting pixel data typically includes several attributes for each pixel, including the depth of the pixel, which reflects how far the geometry covering the pixel is from the view plane. The depth value is known as the “z-value” for the pixel. After rasterization, the pixels continue through the graphics pipeline where shading and texturing operations are performed to determine the final color value for each pixel.
In many graphics pipeline architectures, a “z-test” is one of the last operations performed. In z-testing, the z-value of a current pixel exiting the shading and texturing portion of the pipeline is compared to the z-value stored at a pixel location in frame buffer memory corresponding to the current pixel. The z-value stored in the frame buffer memory at this particular pixel location reflects the depth of the shallowest primitive thus far processed covering the pixel location. This pixel location is referred to herein as the “stored pixel.” Typically, if the z-value of the stored pixel is less than the z-value of the current pixel, then the current pixel is deemed occluded, and the current pixel is discarded. However, if the z-value of the current pixel is less than the z-value of the stored pixel, then the current pixel is deemed to be “in front” of the stored pixel, and the current pixel replaces the stored pixel in the frame buffer.
Conventional z-testing at the end of the graphics pipeline presents several problems. First, such an approach results in unnecessarily processing occluded pixels. Second, because the frame buffer oftentimes resides in off-chip memory, such an approach consumes memory bandwidth unnecessarily by requiring data transfers to and from the frame buffer for every pixel. Third, unnecessary power is consumed by processing occluded pixels and performing memory operations for every pixel.
Techniques for addressing the problems associated with conventional z-testing at the end of the graphics pipeline involve implementing different forms of z-testing earlier in the graphics pipeline in an effort to eliminate occluded pixels before those pixels undergo shading and texturing operations. However, such techniques do not implement z-testing on a granular enough level to discern accurately which pixels associated with a current primitive are visible or occluded relative to previously processed primitives. Consequently, such techniques typically generate a large number of “indeterminate” outcomes, which results in numerous pixels being processed in the graphics pipeline that are ultimately discarded at the end of the graphics pipeline as not being visible.
As the foregoing illustrates, what is needed in the art is a more effective z-testing technique in the earlier stages of the graphics processing pipeline.